package cloud.seri.auth.service.dto

import cloud.seri.auth.config.Constants
import cloud.seri.auth.domain.Dept
import cloud.seri.auth.domain.Role
import cloud.seri.auth.domain.User
import io.swagger.annotations.ApiModel

import javax.validation.constraints.Email
import javax.validation.constraints.NotBlank
import javax.validation.constraints.Pattern
import javax.validation.constraints.Size

import java.time.Instant
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import javax.swing.Spring

/**
 * A DTO representing a user, with his authorities.
 */
@ApiModel("User")
open class UserDTO(
    var id: String? = null,

    @field:NotBlank
    @field:Pattern(regexp = Constants.LOGIN_REGEX)
    @field:Size(min = 1, max = 50)
    var login: String? = null,

    @field:Size(max = 50)
    var userName: String? = null,

    @field:Size(max = 50)
    var realName: String? = null,


    var birthday: LocalDate? = null,

    var phone: String? = null,

    var sex: Int? = null,

    @field:Email
    @field:Size(min = 5, max = 254)
    var email: String? = null,

    @field:Size(max = 256)
    var imageUrl: String? = null,

    var activated: Boolean = false,

    @field:Size(min = 2, max = 6)
    var langKey: String? = null,

    var createdBy: String? = null,

    var createdDate: Instant? = null,

    var lastModifiedBy: String? = null,

    var lastModifiedDate: Instant? = null,

    var roles: List<String>? = null,

    var deptId: String? = null,

    var status: Int? = 0
)


